/*
 * @Author: 谢陈洁
 * @Date: 2025-06-30 08:25:44
 * @LastEditors: 谢陈洁
 * @LastEditTime: 2025-07-18 13:09:58
 * @Description: file content
 */
import type { IFormItem } from "@/components/ProForm/type"

export const searchFormColumns: IFormItem[] = [
  {
    prop: 'name',
    label: '名称',
    value: '',
    type: 'input'
  },
  {
    prop: 'code',
    label: '编码code',
    value: '',
    type: 'input'
  }
]

export const columns = [
  {
    prop: 'id',
    label: 'ID',
    width: 80
  },
  {
    prop: 'name',
    label: '名称',
    width: 200
  },
  {
    prop: 'code',
    label: '编码code',
    type: 'link',
    width: 200,
  },
  {
    prop: 'description',
    label: '描述'
  },
  {
    label: '操作',
    slot: 'action',
    fixed: 'right',
    width: 180
  }
]

export const formColumns: IFormItem[] = [
  {
    prop: 'name',
    label: '名称',
    type: 'input',
    span: 24,
    rules: [{ required: true, message: '请输入名称', trigger: 'blur' }]
  },
  {
    prop: 'code',
    label: 'code',
    type: 'input',
    span: 24,
    rules: [{ required: true, message: '请输入编码code', trigger: 'blur' }]
  },
  {
    prop: 'description',
    label: '描述',
    value: '',
    type: 'input',
    span: 24,
    attrs: {
      type: 'textarea',
      rows: 4
    }
  }
]

export const dicItemColumns: IFormItem[] = [
  {
    prop: 'type_code',
    label: '分类编码',
    value: '',
    type: 'input',
    rules: [{ required: true, message: '请输入分类编码', trigger: 'blur' }],
    config: { disabled: true }
  },
  {
    prop: 'label',
    label: '名称',
    value: '',
    type: 'input',
    rules: [{ required: true, message: '请输入名称', trigger: 'blur' }]
  },
  {
    prop: 'value',
    label: '值',
    value: '',
    type: 'input',
    rules: [{ required: true, message: '请输入字段值', trigger: 'blur' }]
  },
  {
    prop: 'sort',
    label: '排序',
    value: '1',
    type: 'input',
    config: { type: 'number' }
  }
]
